solving quadratic using their graph